﻿<%@ Page Title="" Language="C#" MasterPageFile="~/admin1/SiteAdmin.master" AutoEventWireup="true" CodeFile="ManagerUser.aspx.cs" Inherits="admin1_ManagerUser" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <title>Manager site user</title>
    <style>
        .control-group {
            border-top: 1px solid #ffffff;
            border-bottom: 1px solid #eeeeee;
            margin-bottom: 0;
        }

        .control-label {
            padding-top: 15px;
            width: 180px;
            float: left;
            text-align: right;
        }

        .controls {
            margin-left: 200px;
            padding: 10px 0;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="body" runat="Server">
    <%-- Chinh Sua --%>
    <asp:Panel ID="panel_Edit" Width="100%" runat="server" Visible="False">
        <div class="span12">
            <div class="widget-box">
                <div class="widget-title">
                    <span class="icon">
                        <i class="icon-info-sign"></i>
                    </span>
                    <span class="icon1">
                        <asp:LinkButton ID="lbt_Close_Edit" runat="server" OnClick="lbt_Close_Edit_Click"><img src="img/icons/16/close.png" /></asp:LinkButton>
                    </span>
                    <h5>Chỉnh sửa User</h5>
                </div>
                <div class="widget-content nopadding">
                    <div class="control-group">
                        <label class="control-label">Tài khoản</label>
                        <div class="controls">
                            <asp:TextBox ID="txt_Username_Edit" runat="server" CssClass="null" ValidationGroup="a" Enabled="false"></asp:TextBox>
                        </div>
                    </div>
                   
                    <div class="control-group">
                        <label class="control-label">Tên đầy đủ</label>
                        <div class="controls">
                            <asp:TextBox ID="txt_Fullname_Edit" runat="server" CssClass="null" ValidationGroup="a"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator9" runat="server" ErrorMessage="Chưa nhập tên đầy đủ" ControlToValidate="txt_Fullname_Edit" ValidationGroup="a"></asp:RequiredFieldValidator>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">Công việc hiện tại</label>
                        <div class="controls">
                            <asp:TextBox ID="txt_Job_Edit" runat="server" CssClass="null" ValidationGroup="a"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator10" runat="server" ErrorMessage="Chưa nhập công việc hiện tại" ControlToValidate="txt_Job_Edit" ValidationGroup="a"></asp:RequiredFieldValidator>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">Giới thiệu bản thân</label>
                        <div class="controls">
                            <asp:TextBox ID="txt_Description_Edit" runat="server" CssClass="null" ValidationGroup="a"></asp:TextBox>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label"></label>
                        <div class="controls">
                            <asp:Button ID="btn_Save_Edit" runat="server" Text="Xác nhận" class="btn btn-success" OnClick="btn_Save_Edit_Click" ValidationGroup="a" />
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </asp:Panel>
    <%-- Them Moi --%>
    <asp:Panel ID="panel_Add" Width="100%" runat="server" Visible="False">
        <div class="span12">
            <div class="widget-box">
                <div class="widget-title">
                    <span class="icon">
                        <i class="icon-info-sign"></i>
                    </span>
                    <span class="icon1">
                        <asp:LinkButton ID="lbt_ClosAdd" runat="server" OnClick="lbt_ClosAdd_Click"><img src="img/icons/16/close.png" /></asp:LinkButton>
                    </span>
                    <h5>Thêm Mới User</h5>
                </div>
                <div class="widget-content nopadding">
                    <div class="control-group">
                        <label class="control-label">Tài khoản</label>
                        <div class="controls">
                            <asp:TextBox ID="txt_Name" runat="server" CssClass="null" ValidationGroup="a"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="Chưa nhập tên tài khoản" ControlToValidate="txt_Name" ValidationGroup="a"></asp:RequiredFieldValidator>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">Mật khẩu mới</label>
                        <div class="controls">
                            <asp:TextBox ID="txt_Password" runat="server" CssClass="null" ValidationGroup="a" TextMode="Password"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ErrorMessage="Chưa nhập mật khẩu" ControlToValidate="txt_Password" ValidationGroup="a"></asp:RequiredFieldValidator>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">Nhập lại mật khẩu</label>
                        <div class="controls">
                            <asp:TextBox ID="txt_Password_Confirm" runat="server" CssClass="null" ValidationGroup="a" TextMode="Password"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" ErrorMessage="Chưa nhập lại mật khẩu" ControlToValidate="txt_Password_Confirm" ValidationGroup="a"></asp:RequiredFieldValidator>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">Tên đầy đủ</label>
                        <div class="controls">
                            <asp:TextBox ID="txt_Fullname" runat="server" CssClass="null" ValidationGroup="a"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="Chưa nhập tên đầy đủ" ControlToValidate="txt_Fullname" ValidationGroup="a"></asp:RequiredFieldValidator>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">Công việc hiện tại</label>
                        <div class="controls">
                            <asp:TextBox ID="txt_Job" runat="server" CssClass="null" ValidationGroup="a"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" ErrorMessage="Chưa nhập công việc hiện tại" ControlToValidate="txt_Job" ValidationGroup="a"></asp:RequiredFieldValidator>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">Giới thiệu bản thân</label>
                        <div class="controls">
                            <asp:TextBox ID="txt_Description" runat="server" CssClass="null" ValidationGroup="a"></asp:TextBox>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label"></label>
                        <div class="controls">
                            <asp:Button ID="btnInsert" runat="server" Text="Xác nhận" class="btn btn-success" OnClick="btnInsert_Click" ValidationGroup="a" />
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </asp:Panel>

    <%#Eval("SpeId") %>
    <%-- Hien Thi Thong Tin --%>
    <div class="row-fluid" style="margin-top: 10px;">
        <div class="span12">
            <div class="widget-box">
                <div class="widget-title">
                    <span class="icon"><i class="icon-th"></i></span>
                    <asp:LinkButton ID="lbt_Add_New" runat="server" OnClick="lbt_Add_New_Click"><img src="img/icons/16/add.png"  width="34" /></asp:LinkButton>
                </div>
                <div class="widget-content nopadding">
                    <table class="table table-bordered data-table">
                        <thead>
                            <tr>
                                <th>Tài khoản</th>
                                <th>Tên đầy đủ</th>
                                <th>Công việc</th>
                                <th>Lần đăng nhập cuối</th>
                                <th>Chức năng</th>
                            </tr>
                        </thead>
                        <tbody>
                            <asp:UpdatePanel runat="server" UpdateMode="Conditional" ID="pu_load">
                                <ContentTemplate>
                                    <asp:Repeater ID="rpt_Load" runat="server">
                                        <ItemTemplate>
                                            <tr>
                                                <td class="center"><%# Eval("Username") %></td>
                                                <td><%# Eval("FullName") %></td>
                                                <td class="center"><%# Eval("Job") %></td>
                                                <td class="center"><%# DataBinder.Eval(Container.DataItem, "LastLogin", "{0:dd/MM/yy - HH:mm}")%></td>
                                                <td class="center">
                                                    <asp:LinkButton ID="lbtn_Edit" CommandArgument='<%#Eval("Username") %>' runat="server" OnClick="lbtn_Edit_Click" ToolTip="Chỉnh sửa"><img src="img/icons/16/create.png" width="16" height="18"/></asp:LinkButton>
                                                    &nbsp;&nbsp;<asp:LinkButton ID="lbtn_Del" CommandArgument='<%#Eval("Username") %>' runat="server" OnClick="lbtn_Del_Click" ToolTip="Xóa" OnClientClick="return confirm('Bạn có chắc chắn muốn xóa?')"><img src="img/icons/16/delete.png" width="16" height="18"/></asp:LinkButton>
                                                
                                                </td>
                                            </tr>
                                        </ItemTemplate>
                                    </asp:Repeater>
                                </ContentTemplate>
                            </asp:UpdatePanel>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
</asp:Content>

